package config.center.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * zk properties
 *
 * @author gaowenhao
 * @since 2021/9/16 20:11
 */
@ConfigurationProperties(prefix = "center.config.zoo")
public class ZooProperties {

    private String servers = "127.0.0.1:2181";

    private Integer connectionTimeout = 3500;

    private Integer sessionTimeout = 5000;

    private Retry retry = new Retry();

    public static class Retry {

        private Integer maxRetry = 3;

        private Integer baseSleepTime = 1000;

        private Integer maxSleepTime = 1500;

        public Integer getMaxRetry() {
            return maxRetry;
        }

        public void setMaxRetry(Integer maxRetry) {
            this.maxRetry = maxRetry;
        }

        public Integer getBaseSleepTime() {
            return baseSleepTime;
        }

        public void setBaseSleepTime(Integer baseSleepTime) {
            this.baseSleepTime = baseSleepTime;
        }

        public Integer getMaxSleepTime() {
            return maxSleepTime;
        }

        public void setMaxSleepTime(Integer maxSleepTime) {
            this.maxSleepTime = maxSleepTime;
        }

    }

    public String getServers() {
        return servers;
    }

    public void setServers(String servers) {
        this.servers = servers;
    }

    public Integer getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(Integer connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public Integer getSessionTimeout() {
        return sessionTimeout;
    }

    public void setSessionTimeout(Integer sessionTimeout) {
        this.sessionTimeout = sessionTimeout;
    }

    public Retry getRetry() {
        return retry;
    }

    public void setRetry(Retry retry) {
        this.retry = retry;
    }

}
